<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateCostTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('cost', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('project');
			$table->string('project_no');
			$table->text('description')->nullable();
			$table->string('customer_model_number')->nullable();
			$table->integer('jenkins_model_number')->nullable();
			$table->string('customer_assembly_number')->nullable();
			$table->string('customer_parent_assembly_number')->nullable();
			$table->string('jenkins_assembly_number')->nullable();
			$table->string('jenkins_parent_assembly_number')->nullable();
			$table->string('customer_part_number')->nullable();
			$table->string('jenkins_part_number')->nullable();
			$table->string('customer_drawing_number')->nullable();
			$table->string('revision1')->nullable();
			$table->integer('jenkins_drawing_number')->nullable();
			$table->string('revision2')->nullable();
			$table->float('internal_budgetary_price', 10, 0)->nullable();
			$table->string('internal_budgetary_price_currency', 3)->nullable()->default('RMB');
			$table->float('external_budgetary_price', 10, 0)->nullable();
			$table->string('external_budgetary_price_currency', 3)->nullable()->default('RMB');
			$table->float('internal_alpha_price', 10, 0)->nullable();
			$table->string('internal_alpha_price_currency', 3)->nullable()->default('RMB');
			$table->float('external_alpha_price', 10, 0)->nullable();
			$table->string('external_alpha_price_currency', 3)->nullable()->default('RMB');
			$table->float('internal_beta_price', 10, 0)->nullable();
			$table->string('internal_beta_price_currency', 3)->nullable()->default('RMB');
			$table->float('external_beta_price', 10, 0)->nullable();
			$table->string('external_beta_price_currency', 3)->nullable()->default('RMB');
			$table->float('internal_final_price', 10, 0)->nullable();
			$table->float('external_final_price', 10, 0)->nullable();
			$table->string('external_final_price_currency', 3)->nullable()->default('RMB');
			$table->string('internal_final_price_currency', 3)->nullable()->default('RMB');
			$table->float('quantity_per_product', 10, 0)->nullable();
			$table->string('currency', 3)->nullable()->default('RMB');
			$table->integer('valid')->nullable()->default(1);
			$table->timestamps();
			$table->softDeletes();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('cost');
	}

}
